package com.singularity.onelabel.utils;

import android.util.Log;

import com.singularity.onelabel.AppConfig;

/**
 * Created by Lenovo on 2018/11/14.
 * 封装日志输出类
 */

public class LogUtils {

    // 按照日志等级输出log日志，例如，如果 APPConfig.LOG_GRADE == 5 会输出v等级以及更高级（d/i/w/e）的日志,
    //如果 APPConfig.LOG_GRADE == 3 会输出i等级以及更高级（w/e）的日志,
    public static void log(String msg) {
        switch (AppConfig.LOG_GRADE) {
            case 5:
                Log.v(AppConfig.LOG_TAG, msg);
                break;
            case 4:
                Log.d(AppConfig.LOG_TAG, msg);
                break;
            case 3:
                Log.i(AppConfig.LOG_TAG, msg);
                break;
            case 2:
                Log.w(AppConfig.LOG_TAG, msg);
                break;
            case 1:
                Log.e(AppConfig.LOG_TAG, msg);
                break;
            default:
                break;
        }
    }

}
